// createRouter：创建一个router实例对象
// createWebHistory：创建一个hisstory模式的路由
import { createRouter, createWebHistory } from 'vue-router'

import Layout from '@/views/Layout/index.vue'
import Home from '@/views/Home/index.vue'



const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      component:Layout,
      children:[
        {
          path:'',
          component:Home
        },
      ]
    },
    
  ],
  // 路由行为配置
  scrollBehavior(){
    return {
      top:0
    }
  }
})

export default router

